package DesignPatern.A05_建造者模式.QXB.A03高级模式;

import DesignPatern.A05_建造者模式.QXB.A03高级模式.Builder.BMWBuilder;
import DesignPatern.A05_建造者模式.QXB.A03高级模式.Builder.BenzBuilder;
import DesignPatern.A05_建造者模式.QXB.A03高级模式.Product.BMWModel;
import DesignPatern.A05_建造者模式.QXB.A03高级模式.Product.BenzModel;

import java.util.ArrayList;

/**
 * @Author: Du
 * @Date: 2021/7/21 10:25
 */
public class Director
{
    private ArrayList<String> sequence = new ArrayList<>();
    private BenzBuilder benzBuilder = new BenzBuilder();
    private BMWBuilder bmwBuilder = new BMWBuilder();
    
    /**
     *
     * 奔驰车的模型1
     *
     * @return
     */
    public BenzModel getABenzModel1()
    {
        this.sequence.clear();
        this.sequence.add("start");
        this.benzBuilder.setSequence(this.sequence);
        return (BenzModel) this.benzBuilder.getCarModel();
    }
    
    public BenzModel getABenzModel2()
    {
        this.sequence.clear();
        this.sequence.add("stop");
        this.benzBuilder.setSequence(this.sequence);
        return (BenzModel) this.benzBuilder.getCarModel();
    }
    
    /**
     *
     * 宝马车的模型1
     *
     * @return
     */
    public BMWModel getABMWModel1()
    {
        this.sequence.clear();
        this.sequence.add("start");
        this.sequence.add("alarm");
        this.bmwBuilder.setSequence(this.sequence);
        return (BMWModel) this.bmwBuilder.getCarModel();
    }
    
    public BMWModel getABMWModel2()
    {
        this.sequence.clear();
        this.sequence.add("alarm");
        this.bmwBuilder.setSequence(this.sequence);
        return (BMWModel) this.bmwBuilder.getCarModel();
    }
    
}
